package com.xuecheng.content.service.impl;

import com.xuecheng.content.mapper.CoursePublishMapper;
import com.xuecheng.content.model.po.CoursePublish;
import com.xuecheng.content.service.CoursePublishService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.io.File;

/**
 * 课程发布相关接口实现
 *
 * @author itcast
 */
@Slf4j
@Service
public class CoursePublishServiceImpl implements CoursePublishService {
    @Autowired
    private CoursePublishMapper coursePublishMapper;

    @Override
    public File generateCourseHtml(Long courseId) {
        return new File("");
    }

    @Override
    public void uploadCourseHtml(Long courseId, File file) {
        //远程调用媒资服务上传文件
    }

    /**
     * 根据课程 id查询课程发布信息
     *
     * @param courseId 课程id
     * @return 课程发布信息
     */
    @Override
    public CoursePublish getCoursePublish(Long courseId) {
        return coursePublishMapper.selectById(courseId);
    }

}
